<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class PermissionsSeeder extends Seeder {

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run() {
        $permissionDatas = [
            0 => [
                'id' => 1,
                'pid' => 0,
                'permissions_name' => '首页',
                'urls' => 'admin/index',
                'icon' => '',
                'is_menus' => 0,
                'method' => 'GET',
            ],
            1 => [
                'id' => 2,
                'pid' => 0,
                'permissions_name' => '权限管理',
                'urls' => "#",
                'icon' => 'fa-group',
                'is_menus' => 0,
                'method' => 'GET',
            ],
            2 => [
                'id' => 3,
                'pid' => 2,
                'permissions_name' => '用户列表',
                'urls' => 'admin/user',
                'icon' => 'fa-user-secret',
                'is_menus' => 0,
                'method' => 'GET',
            ],
            3 => [
                'id' => 4,
                'pid' => 3,
                'permissions_name' => '用户删除',
                'urls' => "user/delete",
                'icon' => 'fa-group',
                'is_menus' => 1,
                'method' => 'DELETE',
            ],
            4 => [
                'id' => 5,
                'pid' => 3,
                'permissions_name' => '用户修改',
                'urls' => "user/edit",
                'icon' => 'fa-group',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            5 => [
                'id' => 6,
                'pid' => 3,
                'permissions_name' => '新增用户',
                'urls' => 'user/create',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            6 => [
                'id' => 7,
                'pid' => 3,
                'permissions_name' => '新增提交用户信息',
                'urls' => 'user/store',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'POST',
            ],
            7 => [
                'id' => 8,
                'pid' => 3,
                'permissions_name' => '修改提交用户信息',
                'urls' => 'user/update',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'POST',
            ],
            8 => [
                'id' => 9,
                'pid' => 2,
                'permissions_name' => '角色列表',
                'urls' => 'admin/role',
                'icon' => 'fa-truck',
                'is_menus' => 0,
                'method' => 'GET',
            ],
            9 => [
                'id' => 10,
                'pid' => 9,
                'permissions_name' => '新增角色',
                'urls' => 'role/create',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'POST',
            ],
            10 => [
                'id' => 11,
                'pid' => 9,
                'permissions_name' => '修改角色',
                'urls' => 'role/edit',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'PUT',
            ],
            11 => [
                'id' => 12,
                'pid' => 9,
                'permissions_name' => '删除角色',
                'urls' => 'role/delete',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'DELETE',
            ],
            12 => [
                'id' => 13,
                'pid' => 9,
                'permissions_name' => '新增角色信息提交',
                'urls' => 'role/store',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'POST',
            ],
            13 => [
                'id' => 14,
                'pid' => 9,
                'permissions_name' => '修改角色信息提交',
                'urls' => 'role/update',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'PUT',
            ],
            14 => [
                'id' => 15,
                'pid' => 9,
                'permissions_name' => '角色详情',
                'urls' => 'role/show',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            15 => [
                'id' => 16,
                'pid' => 2,
                'permissions_name' => '菜单列表',
                'urls' => 'admin/permissions',
                'icon' => '',
                'is_menus' => 0,
                'method' => 'GET',
            ],
            16 => [
                'id' => 17,
                'pid' => 16,
                'permissions_name' => '新增菜单',
                'urls' => 'permissions/create',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            17 => [
                'id' => 18,
                'pid' => 16,
                'permissions_name' => '菜单提交',
                'urls' => 'permissions/store',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'POST',
            ],
            18 => [
                'id' => 19,
                'pid' => 16,
                'permissions_name' => '新增权限页面',
                'urls' => 'permission/permissionsView',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            19 => [
                'id' => 20,
                'pid' => 16,
                'permissions_name' => '新增权限信息提交',
                'urls' => 'permission/permissionsCreate',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'POST',
            ],
            20 => [
                'id' => 22,
                'pid' => 16,
                'permissions_name' => '菜单详情',
                'urls' => 'permission/menusView',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            21 => [
                'id' => 23,
                'pid' => 16,
                'permissions_name' => '修改权限',
                'urls' => 'permissions/edit',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'GET',
            ],
            22 => [
                'id' => 24,
                'pid' => 16,
                'permissions_name' => '修改权限信息提交',
                'urls' => 'permissions/update',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'PUT',
            ],
            23 => [
                'id' => 25,
                'pid' => 16,
                'permissions_name' => '删除菜单',
                'urls' => 'permissions/delete',
                'icon' => '',
                'is_menus' => 1,
                'method' => 'DELETE',
            ],
        ];
        DB::table('permissions')->insert($permissionDatas);
    }

}
